#!/bin/sh -e
#append code to request NDN parameters 

OS=`uname -a`
tmp=`echo $OS | grep Ubuntu`
if [ "x$tmp" = "x" ]; then
    echo "Your OS is not Ubuntu"
    exit 2
fi

FILE=/etc/dhcp/dhclient.conf

if [ -f $FILE ]; then
    sudo sh -c "echo 'option nac_server code 246 = string;\nalso request nac_server;\n' >> $FILE"
    sudo sh -c "echo 'option ndn_gateways code 247 = string;\nalso request ndn_gateways;\n' >> $FILE"
    sudo sh -c "echo 'option ndn_namespace code 248 = string;\nalso request ndn_namespace;\n' >> $FILE"
    sudo sh -c "echo 'select-timeout 5\n' >> $FILE"
fi

echo "Code to request NDN paras has been added into $FILE"
